<?php

// Include
include_once('include/includepath.php');
include_once('plugin/LoginPlugin.php');
include_once('plugin/SmartyPlugin.php');
include_once('plugin/AppConfigPlugin.php');
include_once('plugin/CommonPlugin.php');




// Ejecutar la accion
if (isset($_GET[action])) {
	require_once($_GET[action].".php");
}

// Chequea si el usuario ya esta logueado
if (LoginPlugin::isLogged()) {
	header( 'Location: admin.php' );
	exit;
}


// Ejecucion
$smarty = SmartyPlugin::getSmarty();
$appInfo = AppConfigPlugin::getAppInfo();
$message = CommonPlugin::getMessage();
CommonPlugin::setMessage("");


// Smarty call
$smarty->assign('message', $message);
$smarty->assign('appInfo', $appInfo);
$smarty->display('login.tpl');